using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;

namespace ConsoleApplication11.Models.Mapping
{
    public class diagnosisMap : EntityTypeConfiguration<diagnosis>
    {
        public diagnosisMap()
        {
            // Primary Key
            this.HasKey(t => t.diagnosis_id);

            // Properties
            this.Property(t => t.patient_id)
                .HasMaxLength(20);

            this.Property(t => t.diagnosis_by)
                .HasMaxLength(20);

            this.Property(t => t.update_by)
                .HasMaxLength(20);

            // Table & Column Mappings
            this.ToTable("diagnosis");
            this.Property(t => t.diagnosis_id).HasColumnName("diagnosis_id");
            this.Property(t => t.patient_id).HasColumnName("patient_id");
            this.Property(t => t.follow_up_id).HasColumnName("follow_up_id");
            this.Property(t => t.diagnosis_by).HasColumnName("diagnosis_by");
            this.Property(t => t.diagnosis_time).HasColumnName("diagnosis_time");
            this.Property(t => t.update_by).HasColumnName("update_by");
            this.Property(t => t.update_time).HasColumnName("update_time");
            this.Property(t => t.Diagnosis_Type).HasColumnName("Diagnosis_Type");
            this.Property(t => t.Diagnosis_Other).HasColumnName("Diagnosis_Other");
            this.Property(t => t.isBP).HasColumnName("isBP");
            this.Property(t => t.isBL).HasColumnName("isBL");
            this.Property(t => t.isBG).HasColumnName("isBG");
            this.Property(t => t.iSmoking).HasColumnName("iSmoking");
            this.Property(t => t.isBMI).HasColumnName("isBMI");
        }
    }
}
